﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Comisiones.Models
{
    public class PuntoServicio
    {
        //Llaves primarias y foraneas
        [Key, Column(Order = 0)]public int psv_idPtoServicio { get; set; }
        [Key, Column(Order = 1)]public int loc_idLocal { get; set; }
        [Key, Column(Order = 2)]public int com_idComercio { get; set; }
        
        public int? ter_idTerminal { get; set; }
        public int? uni_idUnidadNegocio { get; set; }

        //Atributos
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string psv_codigoDIR { get; set; }

        //Objetos provenientes de las llaves foraneas
        [ForeignKey("loc_idLocal")]
        public Local local { get; set; }
        [ForeignKey("com_idComercio")]
        public Comercio comercio { get; set; }
        [ForeignKey("ter_idTerminal")]
        public Terminal terminal { get; set; }
        [ForeignKey("uni_idUnidadNegocio")]
        public UnidadNegocio unidadNegocio { get; set; }
    }
}